int heightChecker(int* heights, int heightsSize)
{
    int arr[110] = { 0 };

    for (int i = 0; i < heightsSize; i++)
        arr[i] = heights[i];

    for (int i = heightsSize - 1; i > 0; i--)
        for (int j = 0; j < i; j++)
            if (arr[j] > arr[j + 1])
            {
                int tmp = arr[j];
                arr[j] = arr[j + 1];
                arr[j + 1] = tmp;
            }

    int cnt = 0;
    for (int i = 0; i < heightsSize; i++)
        if (arr[i] != heights[i])
            cnt++;

    return cnt;
}